package Days10;

public class brandsText {

    public static void main(String[] args) {
        /*
        定义数组存储3个商品对象，
        商品的属性：商品的ID，名字，价格，库存，
        创建三个商品对象，并且把商品对象存储到对象数组当中去;
         */

        //创建一个对象数组
        brands[] arr = new brands[3];


        //把商品对象创建出来

        brands b2 = new brands("001","下雨",23,34);
        brands b3 = new brands("002","小饼干",34,67);
        brands b4 = new brands("003","小鱼干",35,67);

        arr[0] = b2;
        arr[1] = b3;
        arr[2] = b4;

        for (int i = 0; i < arr.length; i++) {
            brands b6 = arr[i];

            System.out.println(b6.getId() +"," + b6.getName()+ ", "+ b6.getPrice()+ "," + b6.getRemain());
        }
    }


}
